package com.ehcache.ehcache;

import com.caicai.domain.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping(value = "/ehcache")
@RestController
public class EhcacheController {

	@GetMapping
	public  void  putCache(){
		User user=new  User();
		user.setId("1");
		user.setName("菜菜");
		user.setSex("男");
		System.out.println(CacheManage.User_Cache);
		CacheManage.User_Cache.putCache("1",user);


	}

	@GetMapping(value = "/getCache")
	public User getCache(){
		System.out.println(CacheManage.User_Cache.getCache("1"));
		return (User)CacheManage.User_Cache.getCache("1");

	}

}
